<?php $form = $this->beginWidget('CActiveForm', array(
    'id' => 'advertise-form',
    'enableAjaxValidation' => false,
    'htmlOptions' => array(
        'role' => 'form',
        'class' => 'form-horizontal',
    )
)); ?>

<?php if ($model->getErrors()) {
    ?>
    <div class="alert alert-error">
        <?php echo $form->errorSummary($model); ?>
    </div>
<?php } ?>
<div class="form admin-main-wrapper" style="padding: 10px">
    <div class="block block-themed block-last">
        <div class="block-title">
            <h4>Đăng tin rao vặt</h4>
        </div>
        <div class="block-content">

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'title', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'title', array('size' => 60, 'maxlength' => 255)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'content', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textArea($model, 'content', array('rows' => 6, 'cols' => 50)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'category_id', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->dropDownList($model, 'category_id', CHtml::listData($categories, 'id', 'name')); ?>
                </div>
            </div>
            <div style="clear: both;"></div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'phone', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textArea($model, 'phone', array('rows' => 6, 'cols' => 50)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'zipcode', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'zipcode'); ?>
                </div>
            </div>

            <div class="row control-group buttons">
                <div class="controls">
                    <?php echo CHtml::submitButton('Đăng tin', array('class' => 'btn btn-default')); ?>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->endWidget(); ?>

